(The overall Attack power, seen in the STAT menu, is the sum of two parts:
 - A constant based on the character's level, which is already in variable $0A3F.
 - The weapon's battle power, with a 25% bonus for swords.)

[... more of function]

8F/844B: AE BA 0A     LDX $0ABA     (Unique index of weapon held)
8F/844E: F0 54        BEQ $84A4     (if we're empty handed, skip all this)
8F/8450: E0 1A 00     CPX #$001A    (is it a Bazooka?)
8F/8453: D0 20        BNE $8475     (if not, branch)

8F/8455: AD 3F 0A     LDA $0A3F     (get our level-based attack modifier)

8F/8458: 18           CLC
8F/8459: 69 12 00     ADC #$0012    (give 18 Battle Power to bazooka as a bludgeon)
8F/845C: 8D 6A 14     STA $146A
8F/845F: AF 49 23 7E  LDA $7E2349   (type of Bazooka shell currently loaded)
8F/8463: 29 FF 00     AND #$00FF    (just look at bottom 8 bits)
8F/8466: AA           TAX
8F/8467: BF CE 3E C4  LDA $C43ECE,X   (get a 16-bit pointer to this ammo's Battle Power)
8F/846B: AA           TAX
8F/846C: BF 00 00 C4  LDA $C40000,X   (get the Battle Power)
8F/8F70: 8D 3F 0A     STA $0A3F       (note it's overwriting the level-based attack modifier
                                       rather than adding to it)
8F/8473: 80 2F        BRA $84A4


8F/8475: 86 12        STX $12       (save index for later)

8F/8477: BF B4 3E C4  LDA $C43EB4,X    (get a 16-bit pointer to weapon's Battle Power)
8F/847B: AA           TAX
8F/847C: BF 00 00 C4  LDA $C40000,X    (get the Battle Power)

8F/8480: 18           CLC
8F/8481: 6D 3F 0A     ADC $0A3F
8F/8484: 8D 3F 0A     STA $0A3F        (add it to our level-based Attack modifier)

8F/8487: A6 12        LDX $12          (read unique weapon index again)


( Silver Sheath check would likely go here )

8F/8489: BF 42 00 C5  LDA $C50042,X    (weapon type?  Sword = 0, Axe = 2,
                                        Spear = 4, Bazooka = 6)
8F/848D: C9 00 00     CMP #$0000   (is it a sword?)
8F/8490: D0 12        BNE $84A4    (if not, branch)

(Or maaaybe, the Sheath check could be put here...)


8F/8492: BF B4 3E C4  LDA $C43EB4,X
8F/8496: AA           TAX
8F/8497: BF 00 00 C4  LDA $C40000,X   (get the weapon Battle Power again)

8F/849B: 4A           LSR
8F/849C: 4A           LSR         (divide by 4)

8F/849D: 18           CLC
8F/849E: 6D 3F 0A     ADC $0A3F

8F/84A1: 8D 3F 0A     STA $0A3F  (Swords end up with 5/4 Battle Power added to our level-based value)

(At this point, $0A3F will hold the Attack stat, although the Bazooka may revert to the value
 in $1468 if it runs out of shells or it's used when it's not charged yet.)

[more of function...]
